#include "sort2.h"
void testop() {
	srand(time(0));
	const int N = 100000;
	int* a1 = (int*)malloc(sizeof(int) * N);
	int* a2 = (int*)malloc(sizeof(int) * N);
	int* a3 = (int*)malloc(sizeof(int) * N);
	int* a4 = (int*)malloc(sizeof(int) * N);
	int* a5 = (int*)malloc(sizeof(int) * N);
	int* a6 = (int*)malloc(sizeof(int) * N);
	for (int i = 0; i < N - 1; i++) {
		a1[i] = rand();
		a2[i] = a1[i];
		a3[i] = a1[i];
		a4[i] = a1[i];
		a5[i] = a1[i];
		a6[i] = a1[i];
	}
	int begin1 = clock();
	InsertSort(a1, N);
	int end1 = clock();

	int begin2 = clock();
	ShellSort(a2, N);
	int end2 = clock();

	int begin3 = clock();
	SeletSort(a3, N);
	int end3 = clock();

	int begin4 = clock();
	HeapSort(a4, N);
	int end4 = clock();

	printf("%d\n", end1 - begin1);
	printf("%d\n", end2 - begin2);
	printf("%d\n", end3 - begin3);
	printf("%d\n", end4 - begin4);
	free(a1);
	free(a2);
	free(a3);
	free(a4);
	free(a5);
	free(a6);
}
void testinitsort() {
	int a[] = { 6,2,5,3,9,4,8,5,1,7 };
	printarr(a, sizeof(a) / sizeof(a[0]));
	InsertSort(a, sizeof(a) / sizeof(a[0]));
	printarr(a, sizeof(a) / sizeof(a[0]));
}
void testshellsort() {
	int a[] = { 6,2,5,3,9,4,8,5,1,7 };
	printarr(a, sizeof(a) / sizeof(a[0]));
	ShellSort(a, sizeof(a) / sizeof(a[0]));
	printarr(a, sizeof(a) / sizeof(a[0]));
}
void testSeletsort() {
	int a[] = { 6,2,5,3,9,4,8,5,1,7 };
	printarr(a, sizeof(a) / sizeof(a[0]));
	SeletSort(a, sizeof(a) / sizeof(a[0]));
	printarr(a, sizeof(a) / sizeof(a[0]));
}
void testHeapSort() {
	int a[] = { 6,2,5,3,9,4,8,5,1,7 };
	printarr(a, sizeof(a) / sizeof(a[0]));
	SeletSort(a, sizeof(a) / sizeof(a[0]));
	printarr(a, sizeof(a) / sizeof(a[0]));
}
int main() {
	//testinitsort();
	//testshellsort();
	testSeletsort();
	//testHeapSort();
	//testop();

	return 0;
}